<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    /* body{
        width: 500px;
        height: 600px;
        border: 1px solid black
    } */
    ul{
        width: 500px;
        height: 400px;
        border: 1px solid black;
        margin: auto;
        
    }
    li{
        width: 80px;
        height: 40px;
        display: inline-block;
        border: 1px solid black;
        margin: 15px;
        line-height: 40px;
    }
    div{
        width: 200px;
        height: 50px;
        margin-bottom: 0%;
        position: relative;
        border: 1px solid black;
        margin: auto;
        background-color: antiquewhite;
        text-align: center;
    }
    .click{
        font-size: 10px;
        text-align: center;
        line-height: 40px;
        font-family: '仿宋';
        font-weight: bold;
        color: #333;
        background: orange;
        border:1px solid red;
    }
</style>
<body>
    <ul>
        <li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>
        <li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>

    <p style="center:both" ></p>
    <div>屏幕中央</div>
    </ul>
</body>
<script>
    let  lis = document.getElementsByTagName('li');
    for (let i = 0; i < lis.length; i++) {
        lis[i].onclick = function(){
            let res = this.getAttribute('class');
            if(!res){
               this.setAttribute('class','click');
               this.innerText = '座位已选过了';
            }else{
                this.setAttribute('class','');
               this.innerText = '';
            }
        }
        
    }
</script>
</html>